package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.SigninSugarValueDetail;


/**
 * <p>
 * 血糖记录表
 * </p>
 *
 * @author 5146
 * @since 2022-04-14
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_signin_sugar_value")
public class DtrdEntRdPatientSigninSugarValue {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("patient_id")
    private Integer patientId;

    @TableField("record_date")
    private Date recordDate;

    @TableField("record_time")
    private Date recordTime;

    /**
     * 照片以 竖线 | 拼接
     */
    @TableField("record_photo")
    private String recordPhoto;

    /**
     * 1-早餐前,2-早餐后,3-午餐前,4-午餐后,5-晚餐前,6-晚餐后,7-睡前,8-凌晨
     */
    @TableField("sugar_value_time_type_id")
    private Integer sugarValueTimeTypeId;

    /**
     * 血糖值
     */
    @TableField("sugar_value_sugar_value")
    private Float sugarValueSugarValue;

    @TableField("sugar_value_remark")
    private String sugarValueRemark;

    /**
     * 0-客户端,9-微信,10-瞬感蓝牙版,11-瞬感移动版,12-小糖医,13-爱奥乐,14-小程序
     */
    @TableField("sugar_value_source_type")
    private Integer sugarValueSourceType;

    /**
     * 血糖值测量 0-未知,1-偏高,2-正常,3-偏低
     */
    @TableField("sugar_value_type")
    private Integer sugarValueType;

    /**
     * 瞬感设备IMEI
     */
    @TableField("sugar_values_shungan_imei")
    private String sugarValuesShunganImei;

    /**
     * 小糖医IMEI
     */
    @TableField("sugar_values_xty_imei")
    private String sugarValuesXtyImei;

    /**
     * 记录类型, 0-打卡, 1-建档
     */
    @TableField("sugar_value_record_archive_tag")
    private Integer sugarValueRecordArchiveTag;

    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdPatientSigninSugarValue init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdPatientSigninSugarValue parseFromDto(SigninSugarValueDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        recordDate = dto.getRecordDate();
        recordTime = dto.getRecordTime();
        recordPhoto = dto.getRecordPhoto();
        sugarValueTimeTypeId = dto.getSugarValueTimeTypeId();
        sugarValueSugarValue = dto.getSugarValueSugarValue();
        sugarValueRemark = dto.getSugarValueRemark();
        sugarValueSourceType = dto.getSugarValueSourceType();
        sugarValueType = dto.getSugarValueType();
        sugarValuesShunganImei = dto.getSugarValuesShunganImei();
        sugarValuesXtyImei = dto.getSugarValuesXtyImei();
        sugarValueRecordArchiveTag = dto.getSugarValueRecordArchiveTag();
        return this;
    }


}
